<?php
/**
 * Created by PhpStorm.
 * User: zhd
 * Date: 2018/4/24
 * Time: 17:03
 */
$data          = [];
$data['state'] = true;
$data['data']  = [];

$count = 40;
$page  = $_POST['page'];
$limit = $_POST['limit'];

for ($offset = ($page - 1) * $limit, $i = 0; $offset < $count && $i < $limit; $i++, $offset++) {
    $data['data'][] = [
        "id"    => $offset,
        "name"  => "张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三张三",
        "sex"   => "123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456",
        "pwd"   => "123456",
        "state" => $i % 4 == 0 ? "true" : "false",
        "img"   => "http://thirdwx.qlogo.cn/mmopen/vi_32/DYAIOgq83eog1NIhnKAM172w0PR2BCl2zMuk3rW8QMgJn1jcQO5DKSvQ8uHZw53KFez2Tuv8pZib5KI0oIoj1iaw/132",
    ];
}
$data['count'] = $count;
echo json_encode($data);